import React from 'react';
import { Redirect } from 'ice';

const WrapperPage = (WrappedComponent: any) => {
  const auth = {
    isLogin: false
  };

  const Wrapped = (props: any) => {
    return (
      <>
        {
          auth.isLogin ? <WrappedComponent {...props} /> : <Redirect to="/login" />
        }
      </>
    )
  }

  return Wrapped
}

export default WrapperPage;
